<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./api/jquery.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.5.2/vue.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
    <div id="app">{{messsage}}

        <div @click="abcd">000</div>
        <div>
            价格123 <input type="text"  v-model="number">{{123 * number}}
        </div>
        <el-button>默认按钮</el-button>
        <el-date-picker
        v-model="value2"
        align="right"
        type="date"
        placeholder="选择日期"
        :picker-options="pickerOptions">
      </el-date-picker>
        <div style="width:100px;height:100px;background:red;" :style="{background:number == 1?'red':'yellow'}"></div>
    </div>
</body>
</html>

<script src="./api/data.js"></script>
<script>
    const pickerOptions = {disabledDate(time) {
            return time.getTime() > Date.now();
          },
          shortcuts: [{
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }, {
            text: '一周前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', date);
            }
          }]}
 let uid = 113699
 let listUrl = 'http://jx.xuzhixiang.top/ap/api/productlist.php?uid='+uid + '&pagesize=50&pagenum=0'
 new Vue({
     el:'#app',
     data(){
         return{
             messsage:'123',
             number:1,
            value2:''
         }
     },
     methods:{
        abcd(){
            this.messsage = '789'
        }
     },
     mounted(){
         setTimeout(()=>{
            this.messsage = '456'
         },2000)
     }
 })
// let loginUrl = 'http://jx.xuzhixiang.top/ap/api/login.php?username=jpj&password=123456'
// $.ajax({
//     url:loginUrl,
//     type:'get',
//     success:(res)=>{
//         console.log(res,'log')
//         localStorage.setItem('token',res.data.token)
//     }
// })
// $.ajax({
//     url:listUrl,
//     type:'get',
//     success:(res)=>{
//         console.log(res,'res')
//     }
// })


// arr.forEach(v=>{
//     let addUrl = `http://jx.xuzhixiang.top/ap/api/goods/goods-add.php?pimg=${v.pic}&pname=${v.name}&pprice=${v.price}&pdesc=${v.description}&uid=${uid}`
//     $.ajax({
//         url:addUrl,
//         type:'get'
//     })
   
// })


// for(let i =737828;i<=737837;i++){
//     let delUrl = `http://jx.xuzhixiang.top/ap/api/goods/goods-delete.php?uid=${uid}&pid=${i}&token=${localStorage.getItem('token')}`
//     $.ajax({
//         url:delUrl,
//         type:'get'
//     })

// }

// arr.forEach(v=>{
//     let obj = {
//         pimg:v.pic,
//         pname:v.name,
//         pdesc:v.description,
//         uid:113699,
//         pprice:v.price

//     }
//     $.ajax({
//         url:'http://jx.xuzhixiang.top/ap/api/goods/goods-add.php',
//         type:'get',
//         data:obj,
//         async:false,
//         success:()=>{

//         }
//     })
// })
</script>